-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(protocol): add airdrop contracts (not final) #15122
Conversation
Co-authored-by: Daniel Wang <[email protected]>
Co-authored-by: Daniel Wang <[email protected]>
Co-authored-by: Daniel Wang <[email protected]>
Co-authored-by: adaki2004 <[email protected]>
…tion on L2 (#14750) Co-authored-by: Daniel Wang <[email protected]>
Co-authored-by: Daniel Wang <[email protected]>
…14761) Co-authored-by: Daniel Wang <[email protected]>
…oupling (#14778) Co-authored-by: Daniel Wang <[email protected]>
Co-authored-by: Daniel Wang <[email protected]>
Co-authored-by: Daniel Wang <[email protected]> Co-authored-by: Daniel Wang <[email protected]>
@@ -39,6 +44,7 @@ abstract contract MerkleClaimable is OwnableUpgradeable { | |||
bytes32[] calldata proof | |||
) | |||
external | |||
nonReentrant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this (reentrancy check) is not necessary, we solved it 'in-house' already.
A contract is vulnerable if it calls
, sends
or transfers
to an untrusted address (e.g.: contract with malicious fallback function).
A design to prevent that is check-effects interaction. (https://fravoll.github.io/solidity-patterns/checks_effects_interactions.html)
We already have that given (by line 52 + line 58), because the only place an untrusted address can be invoked, is within _claimWIthData()
but we already marked the hash as used
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are sending an ERC1155 token to an target address and the target address is a contract and implement a ERC1155 callback, then the callback can call this contract to re-enter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are sending an ERC1155 token to an target address and the target address is a contract and implement a ERC1155 callback, then the callback can call this contract to re-enter.
Yes. But it would revert because the hash is already “used”. (Line 60)
Lots of conflicts, so rebased to a clean base branch. |
As per issue: #15026
(The merkle tree build up is on purpose written in typescript - not solidity in foundry tests - hence we can reuse at production.)